package com.watson.mq;

import static com.itextpdf.text.pdf.XfaXpathConstructor.XdpPackage.Config;

import com.rabbitmq.client.ConnectionFactory;

/**
 * 功能: MQ配置类
 */
public class RabbitMQHelper {
    //主机：wms_host 账号：wms 密码：wms@@123

    //队列名称
    public static String QUEUE_NAME = "wms_host";
    //MQ地址
    public static final String HOST = "mm.vocen.com.cn";
    //MQ端口号
    public static final int PORT = 5655;
    //MQ账号
    public static final String USERNAME = "wms";
    //MQ密码
    public static final String PASSWORD = "wms@@123";

    public ConnectionFactory getConnectionFactory() {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost(HOST);
        factory.setPort(PORT);
        factory.setVirtualHost("/wms_push");
        factory.setUsername(USERNAME);
        factory.setPassword(PASSWORD);
        factory.setAutomaticRecoveryEnabled(true);// 设置连接恢复
        return factory;
    }
}
